module system_controller (
    input  wire        clk,
    input  wire        rst_n,
    
    // 状态输入
    input  wire        frame_sync,
    input  wire [15:0] energy_levels,
    input  wire [8:0]  estimated_angle,
    input  wire [7:0]  angle_confidence,
    
    // 控制输出
    output wire [1:0]  algorithm_select,
    output wire [7:0]  gain_control,
    output wire        noise_reduction_en,
    output wire [3:0]  eq_bands [7:0],
    output wire [3:0]  system_state,
    
    // 调试接口
    output wire [31:0] debug_info
);

// 状态机
system_state_machine u_state_machine (
    .clk(clk),
    .rst_n(rst_n),
    .frame_sync(frame_sync),
    .energy_levels(energy_levels),
    .system_state(system_state)
);

// 参数自适应
adaptive_parameters u_parameters (
    .clk(clk),
    .rst_n(rst_n),
    .energy_levels(energy_levels),
    .angle_confidence(angle_confidence),
    .algorithm_select(algorithm_select),
    .gain_control(gain_control),
    .noise_reduction_en(noise_reduction_en)
);

performance_monitor u_monitor (
    .clk(clk),
    .rst_n(rst_n),
    .frame_sync(frame_sync),
    .energy_levels(energy_levels),
    .debug_info(debug_info)
);

endmodule